package com.sright.bcard.content.dal.mapper;

import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.BetweenDateParamRequest;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.content.dal.entity.MaterialDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MaterialDOMapper extends BaseMapper<MaterialDO> {
    Integer countByCondition(@Param("materialType") List<Integer> materialType, @Param("between") BetweenDateParamRequest betweenDateParamRequest, @Param("needReview") Integer needReview);

    List<MaterialDO> selectByCondition(@Param("materialType") List<Integer> materialType,
                                       @Param("between") BetweenDateParamRequest betweenDateParamRequest, @Param("page") PageParamRequest request, @Param("needReview") Integer needReview);

    List<MaterialDO> selectByExample(@Param("materialDO") MaterialDO materialDO);

    List<MaterialDO> selectByEnterpriseIdAndType(@Param("materialDO") MaterialDO materialDO);

    Integer deleteById(@Param("id") Long id);

    List<MaterialDO> selectByMaterialIdList(@Param("materialIdList") List<Long> materialIdList);

    List<MaterialDO> selectByEnterpriseId(@Param("enterpriseId") Long enterpriseId);

    List<MaterialDO> selectByMaterialIdAndType(@Param("materialIdList") List<Long> materialIdList, @Param("typeList") List<Integer> typeList);

    Integer selectCountByUserIdAndType(@Param("userId") Long userId, @Param("type") Integer type);

    List<MaterialDO> selectByUserIdAndType(@Param("userId") Long userId, @Param("type") Integer type);

    List<MaterialDO> page(@Param("materialDO") MaterialDO materialDO);

    Integer pageCount(@Param("materialDO") MaterialDO materialDO);

    Integer countShareMaterial(@Param("between") BetweenDateParamRequest between, @Param("needReview") Integer needReview);

    List<MaterialDO> shareMaterialList(@Param("between") BetweenDateParamRequest between, @Param("request") PageParamRequest request, @Param("needReview") Integer needReview);
}
